<template>
  <div class="box">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      background
      layout=" prev, pager, next,sizes,jumper"
      :total="counts"
      :page-sizes="[2, 4, 6, 8]"
      :page-size="pagesize"
      :currentPage="currentPage"
    />
  </div>
</template>

<script>
export default {
  name: 'HmmmXmzsPage',
  //   信息条数
  props: ['counts'],
  data () {
    return {

      // 当前页
      currentPage: 1,
      pagesize: 2
    }
  },
  created () {

  },
  mounted () {},

  methods: {

    // 改变每页条数
    handleSizeChange (val) {
      this.pagesize = val
      this.$emit('handleSizeChange', val, this.currentPage)
    },
    // 改变当前页数
    handleCurrentChange (val) {
      this.currentPage = val
      this.$emit('handleCurrentChange', val, this.pagesize)
    }
  }
}
</script>

<style lang="scss" scoped>
.box {
  display: flex;
  justify-content: flex-end;
}
</style>
